home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / SDKs / Now Utilities Plug Ins 6.0 / API Stuff / Now Tabs Plug Ins ƒ / Empty Trash ƒ / Main.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-03-07  |  1.5 KB  |  57 lines  |  [TEXT/KAHL]

  1. // Empty Trash Plug In
  2. //
  3. // © 1996 Now Software, Inc
  4. // written by: hac
  5.  
  6. #include "Main.h"
  7.  
  8. pascal void main(PlugInInformation *plugInInformation)
  9. {
  10.     plugInInformation->version = kPlugInInformationVersionOne;
  11.     plugInInformation->plugInType = kEmptyTrashPlugInType;
  12.     plugInInformation->PrepareMenu = &PrepareMenu;
  13.     plugInInformation->HandleMenuItemSelected = &HandleMenuItemSelected;
  14. }
  15.  
  16. pascal void PrepareMenu(InstantAccessInformation *information, short asPreview)
  17. {
  18.     MenuItemInformation    menuItem;
  19.     
  20.     
  21.     BlockMove("\pEmpty Trash", menuItem.text, kMenuItemTextSize);
  22.     
  23.     // make a divider above our entry
  24.     menuItem.version = kMenuItemInformationVersionOne;
  25.     menuItem.classification = kMiscellaneousClassification;
  26.     menuItem.type = kDividerMenuItemType;
  27.     menuItem.id = 1;
  28.     menuItem.enabled = false;
  29.     menuItem.style = 0;
  30.     menuItem.mark = 0;
  31.     menuItem.hasSubMenu = false;
  32.     menuItem.subMenu = nil;
  33.     menuItem.refCon = 0;
  34.     menuItem.owningPlugInType = kEmptyTrashPlugInType;
  35.     
  36.     (*information->AddMenuItem)(&menuItem);
  37.     
  38.     // Add the menu item
  39.     menuItem.type = kTextMenuItemType;
  40.     menuItem.id = 2;
  41.     menuItem.enabled = true;
  42.     
  43.     (*information->AddMenuItem)(&menuItem);
  44.     
  45.     // Add a divider
  46.     menuItem.type = kDividerMenuItemType;
  47.     menuItem.id = 3;
  48.     menuItem.enabled = false;
  49.     
  50.     (*information->AddMenuItem)(&menuItem);
  51. }
  52.  
  53. pascal void HandleMenuItemSelected(InstantAccessInformation *information, MenuItemInformation *menuItem)
  54. {
  55.     (*information->SelectFinderMenuItem)("\pSpecial", "\pEmpty Trash");
  56. }
  57.